package main

import (
	"fmt"
	"github.com/golang-module/carbon/v2"
	"go_19/core"
)

// https://github.com/golang-module/carbon/blob/master/README.cn.md
func main() {
	core.Cli()
	fmt.Println(carbon.Now())                      //2024-10-11 14:04:17
	fmt.Println(carbon.Now().ToDateString())       //2024-10-11
	fmt.Println(carbon.Now().ToTimeString())       //14:05:44
	fmt.Println(carbon.Yesterday())                //2024-10-10 14:04:17
	fmt.Println(carbon.Yesterday().ToDateString()) //2024-10-10
	fmt.Println(carbon.Yesterday().ToTimeString()) //14:04:17
	fmt.Println(carbon.Now().AddDays(1))           //
	fmt.Println(carbon.Now().AddMonths(1))         //

	//同PHPcarbon Carbon::parse("2023-03-31")->subMonth(1)->toDateString())
	fmt.Println(carbon.Parse("2023-03-31").SubMonths(1).ToDateString())

}
